<template>
  <div class="home">
    <p>{{globalState}}</p>
    <button @click="setGlobalState">setGlobalState</button>
  </div>
</template>

<script>
// @ is an alias to /src

export default {
  name: 'Home',
  components: {
  },
  computed:{
    globalState(){
      return JSON.stringify(this.$store.state.globalState)
    }
  },
  created(){
  },
  methods:{
    setGlobalState(){
      this.$store.dispatch('setGlobalState',{name:'xiaohei',age:6})
    }
  }
}
</script>
